package threading;

/**
 * @author 徐志荣
 * @date 2023/3/19 9:58
 */
public class ThreadDemo15 {
    public static void main(String[] args) throws InterruptedException {
        Object object = new Object();
        System.out.println("wait 之前");
        //加锁的对象必须和 wait对象是同一个
        synchronized (object) {
            object.wait();
        }
        //notify也是要放到 synchronized 中使用

        System.out.println("wait 之后");
    }
}
